<?php
/**
 * Created by PhpStorm.
 * User: 哇咔咔
 * Date: 17-9-4
 * Time: 上午11:06
 */

defined('BASEPATH') OR exit('No direct script access allowed');

class Service extends MY_Controller {
    function index(){
        $data['company'] = parent::company();//公司基本信息
        $column = parent::column('服务管理');
        $data['url'] =parent::pic_url($data['company'] ['id']);
        $arr = array(
            'company_id'=>$data['company'] ['id'],
            'pic_type' =>  '02',
            'del_flag' =>  '0',
            'column_id' => $column['id']
        );
        $arr1 = parent::arr();
        $data['pic'] = $this->db->from('picture')->where($arr)->get()->row_array();
        //获取服务列表
        $data['service'] = $this->db->from('service_info')->where($arr1)->limit(5,0)->get()->result_array();
        $this->load->view('service/service_list',$data);
    }


    //服务的详情
   function service_info(){
       $id = $this->uri->segment(4);
       $data['company'] = parent::company();//公司基本信息
       $data['url'] =parent::pic_url($data['company'] ['id']);
       $arr = parent::arr_id($id);
       //获取服务的详细信息
       $data['service'] = $this->db->from('service_info')->where($arr)->get()->row_array();
       $this->load->view('service/service_show',$data);
   }
}